<script>
export default {
    props: {
        title: {
            type: String,
            default: ''
        },
        keyName: {
            type: String,
            default: ''
        },
        allInfo: {
            type: Object,
            default: {}
        }
    },
    methods: {
        downloadFile(fileItem) {
            window.open(fileItem.path)
        }
    }
}
</script>
<template>
    <div class="item flex-col">
        <view class="name text-gray-535353 fz26">
            {{ title }}
        </view>
        <div class="file-item mt-20 between bg-gray-300 p-10 rounded-10"
            v-for="(fileItem, index) in get(allInfo, keyName, '')" :key="index">
            <div class="flex" style="width: 85%;word-break: break-all;">
                <u-icon name="file-text" size="40rpx" color="#278AFF"></u-icon>
                <div class="fz28 ml-14 text-111">
                    {{ fileItem.path.split('/')[fileItem.path.split('/').length - 1] }}
                </div>
            </div>
            <image src="/static/icon/download.png" mode="widthFix" class="w-30 mr-20" @click="downloadFile(fileItem)">
            </image>
        </div>
    </div>
</template>

<style lang="less">
.text-gray-535353 {
    color: #535353;
}
</style>
